package com.example.dangerouscargodriver.ui.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.baiju.style.citylist.Toast.ToastUtils;
import com.example.dangerouscargodriver.R;
import com.example.dangerouscargodriver.utils.TextUtils;
import com.example.dangerouscargodriver.widget.ActionBar;

public class BindingOfficialCardActivity extends AppCompatActivity {

	private static String TAG = "BindingOfficialCard";
	private static final int BINDING_PERSONAL_CARD_TYPE = 2;

	private ActionBar mActionBar = null;
	private TextView mProtocol = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_binding_official_card);

		mProtocol = findViewById(R.id.tv_protocol);

		TextUtils.getBuilder().click(getResources().getString(R.string.company_partner_protocol), getResources().getColor(R.color.liji_c_blue), new TextUtils.OnClickListener() {
			@Override
			public void onClick(int position) {
				switch (position){
					case 0:
						//跳转链接
						//ToastUtils.showShortToast(BindingCardActivity.this, "0");
						Intent intent = new Intent(BindingOfficialCardActivity.this, ShowHtmlActivity.class);
						startActivity(intent);
						break;
					case 1:
						ToastUtils.showShortToast(BindingOfficialCardActivity.this, "1");
						break;
				}
			}
		}, "《危司机用户服务协议》", "《电子签约数字证书用户使用须知》").checkBox(this,  mProtocol, new TextUtils.OnImageClickListener() {
			@Override
			public void onChecked() {
				//ToastUtils.showShortToast(BindingCardActivity.this, "checked");
			}

			@Override
			public void onUnChecked() {
				//ToastUtils.showShortToast(BindingCardActivity.this, "unChecked");
			}
		}).clickInto(mProtocol);

		mActionBar = findViewById(R.id.actionBarBindOfficialCard);
		mActionBar.setOnBackClickListener( new View.OnClickListener(){

			@Override
			public void onClick(View v) {
				finish();
			}
		});
	}
}